package com.hae.shop.product.api;

import com.hae.shop.common.base.Response;
import com.hae.shop.product.model.ProductDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotBlank;
import java.util.List;

@Api(description = "商品服务接口")
public interface ProductService {

    @ApiOperation(value = "商品检索服务")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "key", dataType = "String", required = true, value = "商品关键字"), })
    @PostMapping("/searchGoods")
    Response<List<ProductDto>> searchGoods(@RequestParam("key") @NotBlank(message = "关键字不能为空！") String key);
}
